package com.siashan.unipay4j.ali.pay;

import com.siashan.unipay4j.core.IBaseEnum;
import com.siashan.unipay4j.core.TradeStateEnum;

/**
 * 支付宝交易状态
 *
 * 在支付宝的业务通知中，只有交易通知状态为TRADE_SUCCESS或TRADE_FINISHED时，支付宝才会认定为买家付款成功。
 *
 * @author  siashan
 * @since v1.0.1
 **/
public enum AliTradeStateEnum implements IBaseEnum<String> {
    /**
     * 交易支付成功
     */
    TRADE_SUCCESS("TRADE_SUCCESS", "交易支付成功",TradeStateEnum.SUCCESS),
    /**
     * 交易创建，等待买家付款
     */
    WAIT_BUYER_PAY("WAIT_BUYER_PAY", "交易创建，等待买家付款",TradeStateEnum.WAIT_PAY),
    /**
     * 未付款交易超时关闭，或支付完成后全额退款
     */
    TRADE_CLOSED("TRADE_CLOSED", "未付款交易超时关闭，或支付完成后全额退款",TradeStateEnum.CLOSED),
    /**
     * 交易结束，不可退款
     */
    TRADE_FINISHED("TRADE_FINISHED", "交易结束，不可退款",TradeStateEnum.SUCCESS),
    ;
    private String value;
    private String desp;
    private TradeStateEnum tradeState;

    AliTradeStateEnum(String value, String desp,TradeStateEnum tradeState) {
        this.value = value;
        this.desp = desp;
        this.tradeState = tradeState;
    }

    @Override
    public String getValue() {
        return value;
    }

    public void setValue(String value) {
        this.value = value;
    }

    @Override
    public String getDesp() {
        return desp;
    }

    public void setDesp(String desp) {
        this.desp = desp;
    }

    public TradeStateEnum getTradeState() {
        return tradeState;
    }

    public void setTradeState(TradeStateEnum tradeState) {
        this.tradeState = tradeState;
    }
}
